﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/MasterPage.master" AutoEventWireup="true" CodeFile="Claims_OLD.aspx.cs" Inherits="Claims_Claims" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    
    <telerik:RadAjaxPanel runat="server" LoadingPanelID="RadAjaxLoadingPanel1" 
    ID="RadPnlMain" ForeColor="Black" Width="1200px">
    
    <asp:LinkButton ID="lnlBtnAddClaims" runat="server" Text="Добави ново оплакване" 
            ForeColor="Black" onclick="lnlBtnAddClaims_Click"/>
    
    <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGridClaims">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGridClaims" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px"
        Width="75px">
        <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'
            style="border: 0px;" />
    </telerik:RadAjaxLoadingPanel>
    
    <telerik:RadGrid ID="RadGridClaims" runat="server" 
        DataSourceID="LinqDataSourceClaims" GridLines="None" 
        onselectedindexchanged="RadGridClaims_SelectedIndexChanged" 
            AllowAutomaticUpdates="True">
        <HeaderContextMenu EnableTheming="True">
        <ItemTemplate>
            <asp:Button runat="server" ID="a1" Text="11" Visible="true"/>
        </ItemTemplate>
        <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
        </HeaderContextMenu>

        <MasterTableView AutoGenerateColumns="False" DataKeyNames="ClaimId" 
            DataSourceID="LinqDataSourceClaims">
            <RowIndicatorColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
            </RowIndicatorColumn>

            <ExpandCollapseColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
            </ExpandCollapseColumn>
        
            <Columns>
            
                <telerik:GridButtonColumn UniqueName="Select" ButtonType="LinkButton"
                 CommandName="Select" Text="Преглед">
                </telerik:GridButtonColumn>
        
                <telerik:GridButtonColumn UniqueName="Edit" ButtonType="LinkButton"
                CommandName="Edit" Text="Редакция">
                </telerik:GridButtonColumn>
                     
                <telerik:GridDropDownColumn UniqueName="CustomerId" DataSourceID="LinqDataSourceCustomers"
                ListTextField="Name" ListValueField="CustomerId" HeaderText="Клиент" DataField="CustomerId">
                </telerik:GridDropDownColumn>
                
                <telerik:GridDropDownColumn UniqueName="SupplierId" DataSourceID="LinqDataSourceSuppliers"
                ListTextField="Name" ListValueField="SupplierId" HeaderText="Доставчик" DataField="SupplierID">
                </telerik:GridDropDownColumn>
                
                <telerik:GridBoundColumn DataField="DelyNote" HeaderText="DelyNote" 
                SortExpression="DelyNote" UniqueName="DelyNote">
                </telerik:GridBoundColumn>
                
                <telerik:GridDateTimeColumn UniqueName="ArrivalDate" DataField="ArrivalDate" DataType="System.DateTime"
                HeaderText="Дата пристигане" SortExpression="ArrivalDate" DataFormatString="{0:MM/dd/yy}">
                </telerik:GridDateTimeColumn>
                
                <telerik:GridDropDownColumn DataSourceID="LinqDataSourceRequestedAction" DataField="RequestedActionId"
                HeaderText="Искано действие" SortExpression="RequestedActionId" ListTextField="Text" ListValueField="RequestedActionId">
                </telerik:GridDropDownColumn>
                
                <telerik:GridTemplateColumn UniqueName="OtherAction" HeaderText="Други действия"
                SortExpression="OtherAction">
                <ItemTemplate>
                    <%#DataBinder.Eval(Container.DataItem,"OtherAction")%>
                </ItemTemplate>
                <EditItemTemplate>       
                        
                <div style="float:right">               
                    <asp:RequiredFieldValidator ID="rfvOtherAction" runat="server" 
                    ErrorMessage="RequiredFieldValidator" Text="Въведете стойност" ControlToValidate="rtbOtherAction"/>                 
                </div>
                <div style="float:right">
                    <telerik:RadTextBox ID="rtbOtherAction" runat="server" Text='<%# Bind("OtherAction") %>'> 
                    
                    </telerik:RadTextBox>
                </div>                                       
                </EditItemTemplate>               
                </telerik:GridTemplateColumn>
                
                
                               
                <telerik:GridDateTimeColumn UniqueName="ClaimNoteDate" DataField="ClaimNoteDate" DataType="System.DateTime"
                HeaderText="Дата на оплакването" SortExpression="ClaimNoteDate" DataFormatString="{0:MM/dd/yy}">
                </telerik:GridDateTimeColumn>
                
                <telerik:GridBoundColumn DataField="ClaimNum" HeaderText="ClaimNum" 
                SortExpression="ClaimNum" UniqueName="ClaimNum">
                </telerik:GridBoundColumn>
                
                <telerik:GridBoundColumn DataField="Supplier" HeaderText="Supplier" 
                SortExpression="Supplier" UniqueName="Supplier">
                </telerik:GridBoundColumn>
                               
                <telerik:GridDropDownColumn DataField="ReferenceId" HeaderText="ReferenceId"  UniqueName="ReferenceId"               
                DataSourceID="LinqDataSourceReferences" ListValueField="ReferenceId" ListTextField="ReferenceName">
                </telerik:GridDropDownColumn>
                
                <telerik:GridBoundColumn DataField="OrderNum" HeaderText="OrderNum" 
                SortExpression="OrderNum" UniqueName="OrderNum">
                </telerik:GridBoundColumn>
                
            </Columns>
        
        </MasterTableView>

        <FilterMenu EnableTheming="True">
        <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
        </FilterMenu>
    </telerik:RadGrid>
    
    </telerik:RadAjaxPanel>
    
    <%--Data sources:--%>
    <asp:LinqDataSource ID="LinqDataSourceClaims" runat="server" 
        ContextTypeName="ItemsDataContext" EnableUpdate="True" TableName="Claims">
    </asp:LinqDataSource>
    
    <asp:LinqDataSource ID="LinqDataSourceCustomers" runat="server" 
        ContextTypeName="ItemsDataContext" Select="new (Name, CustomerID)" 
        TableName="Customers">
    </asp:LinqDataSource>
             
    <asp:LinqDataSource ID="LinqDataSourceSuppliers" runat="server" 
                ContextTypeName="ItemsDataContext" Select="new (Name, SupplierID)" 
                TableName="Suppliers">
        </asp:LinqDataSource>
             
    <asp:LinqDataSource ID="LinqDataSourceReferences" runat="server" 
            ContextTypeName="ItemsDataContext" Select="new (ReferenceId, ReferenceName)" 
            TableName="References">
        </asp:LinqDataSource>
    
    
    <asp:LinqDataSource ID="LinqDataSourceRequestedAction" runat="server" 
            ContextTypeName="ItemsDataContext" Select="new (RequestedActionId, Text)" 
            TableName="RequestedActions">
    </asp:LinqDataSource>
    
    <asp:LinqDataSource ID="Status" runat="server" 
            ContextTypeName="ItemsDataContext" Select="new (status1, id)" 
            TableName="Status">
        </asp:LinqDataSource>
    
</asp:Content>

